namespace AgileBoard.Tests
{
    using AgileBoard.Infrastructure.Data.NHibernateMaps;
    using Infrastructure.Data.NHibernateMaps;
    using NHibernate.Cfg;
    using NHibernate.Tool.hbm2ddl;
    using NUnit.Framework;
    using SharpArch.Data.NHibernate;
    using SharpArch.Testing.NHibernate;

    [SetUpFixture]
    public class AssemblyExecutionController
    {
        const string NhibernateConfig = "../../../../app/AgileBoard.Web/NHibernate.config";

        private Configuration configuration;

        [SetUp]
        public void RunBeforeAnyTests()
        {
            var mappingAssemblies = RepositoryTestsHelper.GetMappingAssemblies();
            configuration = NHibernateSession.Init(new SimpleSessionStorage(), mappingAssemblies,
                                       new AutoPersistenceModelGenerator().Generate(),
                                       NhibernateConfig);

            var session = NHibernateSession.GetDefaultSessionFactory().OpenSession();

            new SchemaExport(configuration).Execute(false, true, false, session.Connection, null);

            IntegrationDatabase.Populate(session);
        }

        [TearDown]
        public void RunAfterAnyTests()
        {
            
        }
    }
}